﻿using System;

namespace DotNetImage.Imaging
{
    public class Validator
    {
        public static void ValidateInclusiveRange(string paramName, double input, double minAllowed, double maxAllowed)
        {
            if (input < minAllowed)
            {
                throw new ArgumentOutOfRangeException(paramName, string.Format("Parameter value must not be less than {0} but it is {1}", input, minAllowed));
            }
            if (input > maxAllowed)
            {
                throw new ArgumentOutOfRangeException(paramName, string.Format("Parameter value must not be more than {0} but it is {1}", input, maxAllowed));
            }
        }
    }
}
